<?php
$widget_params = isset($widget_params) ? $widget_params : [];
$choice_name = \Illuminate\Support\Arr::get($widget_params, 'name', 'user_id');
$choice_label = \Illuminate\Support\Arr::get($widget_params, 'label', '用 户');
$choice_placeholder = \Illuminate\Support\Arr::get($widget_params, 'placeholder', '账号、用户名、手机号');
$search = isset($search) ? $search : \Illuminate\Support\Facades\Request::all();
?>
<div class="layui-inline choice-container" id="choice-{{$choice_name}}">
    <label class="layui-form-label">{{$choice_label}}:</label>
    <div class="layui-input-block">
        <input type="text" name="{{$choice_name.'_name'}}"
               value="{{\Illuminate\Support\Arr::get($search,$choice_name.'_name','')}}" class="layui-input"
               placeholder="{{$choice_placeholder}}"/>
        <a class="layui-btn icon-btn">
            <input type="hidden" value="{{\Illuminate\Support\Arr::get($search,$choice_name,'')}}"
                   name="{{$choice_name}}"/>选择
        </a>
    </div>
</div>
@push('script')
    <script type="text/javascript">
        SystemUtil.choice_render({
            url: "{{admin_url('system/user/choose')}}",
            title: "选择{{$choice_label}}",
            elem: '#choice-{{$choice_name}}',
            showField: 'username',
        });
    </script>
@endpush